package org.familysearch.fsapi.gwt.samples.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class FamilySearchSample implements EntryPoint {

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {
    
	Image img = new Image("http://code.google.com/webtoolkit/logo-185x175.png");
	Image fsImg = new Image("familysearch.gif");
	Image plusImg = new Image("plus.png");
	
	HorizontalPanel panel = new HorizontalPanel();
	panel.setWidth("400");
	panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
	panel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
	
	panel.add(fsImg);
	panel.add(plusImg);
	panel.add(img);
	
	panel.setCellVerticalAlignment(fsImg, HorizontalPanel.ALIGN_MIDDLE);
	panel.setCellVerticalAlignment(plusImg, HorizontalPanel.ALIGN_MIDDLE);
	panel.setCellVerticalAlignment(img, HorizontalPanel.ALIGN_MIDDLE);

	
	// DEMOS
	ReadPersonSample readPersonSample = new ReadPersonSample();
	TempleListSample templeListSample = new TempleListSample();
	
	VerticalPanel vert = new VerticalPanel();
	vert.addStyleName("widePanel");
	vert.add(panel);
	vert.setCellHorizontalAlignment(panel, HorizontalPanel.ALIGN_CENTER);
	
	// add demos
	vert.add(readPersonSample);
	vert.setCellHorizontalAlignment(readPersonSample, HorizontalPanel.ALIGN_CENTER);
	
	vert.add(new HTML("&nbsp;<br>"));
	
	vert.add(templeListSample);
	vert.setCellHorizontalAlignment(templeListSample, HorizontalPanel.ALIGN_CENTER);
	
	// Add image and button to the RootPanel
	RootPanel.get().add(vert);

}
}
